<template>
  <div>
    <div class="container-fluid">
      <el-row class="spannel_list" :gutter="10">
        <el-col :sm="6" :xs="12">
          <div class="spannel">
            <em>10015</em><span>篇</span>
            <b>总文章数</b>
          </div>
        </el-col>
        <el-col :sm="6" :xs="12">
          <div class="spannel scolor01">
            <em>123</em><span>篇</span>
            <b>日新增文章数</b>
          </div>
        </el-col>
        <el-col :sm="6" :xs="12">
          <div class="spannel scolor02">
            <em>35</em><span>篇</span>
            <b>评论总数</b>
          </div>
        </el-col>
        <el-col :sm="6" :xs="12">
          <div class="spannel scolor03">
            <em>123</em><span>篇</span>
            <b>日新增文章数</b>
          </div>
        </el-col>
      </el-row>

    </div>
    <div class="container-fluid">
      <el-row class="curve-pie" :gutter="10">
        <el-col :sm="16" :xs="16">
         <div class="gragh_pannel" id="curve_show"></div>
        </el-col>
        <el-col :sm="8" :xs="8">
          <div class="gragh_pannel" id="pie_show"></div>
        </el-col>
      </el-row>
    </div>
    <div class="container-fluid">
      <div class="column_pannel" id="curve_show"></div>
    </div>
  </div>
</template>

<script>
import * as echarts from 'echarts'
export default {
  name: 'my-home',
  mounted () {
    // 初始化面积图
    this.initCurve()
  },
  methods: {
    // 初始化面积图
    initCurve () {
      const myChart = echarts.init(document.getElementById('curve_show'))
      // 绘制图表
      myChart.setOption({
        xAxis: {
          type: 'category',
          boundaryGap: false,
          data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
        },
        yAxis: {
          type: 'value'
        },
        series: [
          {
            data: [820, 932, 901, 934, 1290, 1330, 1320],
            type: 'line',
            areaStyle: {}
          }
        ]
      })
    }
  }
}
</script>

<style lang="less" scoped>
.spannel_list{
  margin-top: 20px;
}

.spannel{
  height: 100px;
  overflow: hidden;
  text-align: center;
  position: relative;
  background-color: #fff;
  border: 1px solid #e7e7e9;
  margin-bottom: 20px
}
.spannel em{
  font-style: normal;
  font-size: 50px;
  line-height: 50px;
  display: inline-block;
  margin: 10px 0 0 20px;
  font-family: 'Arial';
  color: #83a2ed;
}
.spannel span{
  font-size: 14px;
  display: inline-block;
  color: #83a2ed;
  margin-left: 10px;
}
.spannel b{
  position: absolute;
  left: 0;
  bottom:0;
  width: 100%;
  line-height: 24px;
  background: #e5e5e5;
  color: #333;
  font-size: 14px;
  font-weight: normal;
}
.scolor02 em,
.scolor02 span{
  color:#6ac6e2;
}

.scolor02 em,
.scolor02 span{
  color:#5fd9de;
}
.scolor03 em,
.scolor03 span{
  color:#58d88e;
}
.gragh_pannel{
  height: 350px;
  border: 1px solid #e7e7e9;
  background-color:#fff !important;
  margin-bottom:20px;
}
.column_pannel{
  margin-bottom: 20px;
  height: 400px;
  border: 1px solid #e7e7e9;
  background-color: #fff !important;
}
</style>
